      SUBROUTINE  INTERP(XX,P,C1,DC,C2,EPSIL,JUMP)
      REAL*8  X,Y,XC,YC,X1,Y1,X2,Y2
      DIMENSION  X(20),Y(20)
C
C PURPOSE - TO FIND A ROOT OF Y(X,P)=0 BETWEEN X=C1(DC)C2
C           P IS A PARAMETER
C OUTPUT - XX=ROOT
C          JUMP=0  IF ROOT NOT FOUND
C              =1  IF ROOT FOUND
C
      M=0
      JUMP=0
      XC=C1
  100 CONTINUE
C
      CALL  FUNCT(YC,XC,P,IER)
C
      IF(IER)  1600,1050,1600
 1050 CONTINUE
c      WRITE(6,1051)  XC,YC
 1051 FORMAT(1H ,F12.5,5X,D12.5)
      IF(EPSIL)  1400,1400,1060
 1060 CONTINUE
      IF(M-1)  1100,1200,1310
C
C FIRST TRIAL
C
 1100 CONTINUE
      M=1
      X1=XC
      Y1=YC
      X(1)=XC
      Y(1)=YC
      IF(YC)  1400,1500,1400
C
C A ZERO CROSSING HAS NOT BEEN REACHED
C
 1200 CONTINUE
      IF(Y1)  1210,1500,1220
 1210 CONTINUE
      IF(YC)  1100,1500,1300
 1220 CONTINUE
      IF(YC)  1300,1500,1100
C
C A ZERO CROSSING IS FOUND
C
 1300 CONTINUE
      X2=XC
      Y2=YC
      GO TO  1350
C
C TO CHECK IF YC IS BETWEEN Y1 AND Y2
C
 1310 CONTINUE
      IF(Y1-YC)  1320,1320,1330
 1320 CONTINUE
      IF(Y2-YC)  1340,1340,1350
 1330 CONTINUE
      IF(Y2-YC)  1350,1340,1340
C
C YC IS OUTSIDE OF (Y1,Y2)
C
 1340 CONTINUE
      IF(YC)  1342,1342,1344
 1342 CONTINUE
      IF(Y1)  1343,1343,1345
 1343 CONTINUE
      X1=XC
      Y1=YC
      GO TO  1346
 1344 CONTINUE
      IF(Y1)  1345,1343,1343
 1345 CONTINUE
      X2=XC
      Y2=YC
 1346 CONTINUE
      X(1)=X1
      Y(1)=Y1
      X(2)=X2
      Y(2)=Y2
      M=1
      GO TO  1355
C
C INTERPOLATION BY A LAGRANGE FORMULA
C
 1350 CONTINUE
      X(M+1)=XC
      Y(M+1)=YC
C
 1355 CONTINUE
      DO  1360  KK=1,M
      X(M-KK+1)=(-Y(M-KK+1)*X(M-KK+2)+Y(M+1)*X(M-KK+1))
     1         /(Y(M+1)-Y(M-KK+1))
 1360 CONTINUE
      ERROR=(XC-X(1))/XC
      IF(ABS(ERROR)-EPSIL)  1500,1500,1370
 1370 CONTINUE
      XC=X(1)
      M=M+1
      GO TO  1410
C
C INCREASE XC BY DC
C
 1400 CONTINUE
      XC=XC+DC
C CHECK IF XC IS IN THE RANGE (C1,C2)
 1410 CONTINUE
      IF((XC-C1)*(XC-C2))  100,100,1600
C
C A ROOT IS FOUND
C
 1500 CONTINUE
      JUMP=1
      XX=XC
      GO TO  1000
C
C A ROOT IS NOT FOUND
C
 1600 CONTINUE
c      WRITE(6,1601)
 1601 FORMAT(1H0,7HNO ROOT)
      GO TO  1000
C
C EXIT
C
 1000 CONTINUE
      RETURN
      END
